package com.wang.friend.service.impl;

import com.wang.common.file.domain.OSSResult;
import com.wang.common.file.service.OSSService;
import com.wang.friend.service.IFileService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;

@Service
public class FileServiceImpl implements IFileService {

    @Autowired
    private OSSService ossService;

    @Override
    public OSSResult upload(MultipartFile file) {
        try {
            return ossService.uploadFile(file);
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
}
